<template>
  <div class="mui-numbox" data-numbox-min="1">
    <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
    <input id="test" class="mui-input-numbox" type="number" value="1" ref="ballRef" @change="numChange">
    <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  </div>
</template>
<script>
import mui from '../../lib/MUI/dist/js/mui.min.js'
export default {
  data() {
    return {
    }
  },
  methods: {
    numChange() {
      this.$emit("getcount", parseInt(this.$refs.ballRef.value))
    }
  },
  props: ["max"],
  mounted() {
    mui(".mui-numbox").numbox()
  },
  watch: {
    max: function (newVal, oldVal) {
      mui(".mui-numbox").numbox().setOption("max", newVal)
    }
  }
};
</script>
style <style lang="scss" scoped>
</style>
